using System;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Security;
using Microsoft.SharePoint.Administration;

namespace Mystery.SharePoint.Features.WebApplication
{
    /// <summary>
    /// This class handles events raised during feature activation, deactivation, installation, uninstallation, and upgrade.
    /// </summary>
    /// <remarks>
    /// The GUID attached to this class may be used during packaging and should not be modified.
    /// </remarks>

    [Guid("13987144-9c68-4709-a53a-7c74e78a18b9")]
    public class WebApplicationEventReceiver : SPFeatureReceiver
    {
        public override void FeatureActivated(SPFeatureReceiverProperties properties)
        {
            SPWebApplication app = properties.Feature.Parent as SPWebApplication;
            app.ProvisionInfrastructure();
        }
        public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
        {
            SPWebApplication app = properties.Feature.Parent as SPWebApplication;
            app.DeprovisionInfrastructure();
        }
    }
}
